using System;
using Godot;

namespace Box.Base {
	public partial class NoiseGenerator : FastNoiseLite {

		public NoiseGenerator() {}

		public NoiseGenerator(int seed = 233) {
			Seed = seed;
		} 

		public float IslandNoise(Vector2 p,int width,int height) {
			float cx = width/ 2,cy = height / 2;
			float dx = (p.x - cx) / width,dy = (p.y - cy) /height;
			float d = (float)(Mathf.Sqrt(dx * dx + dy * dy) / 0.61);
			float n = (1 + GetNoise2dv(p)) / 2;
			return (n - d);
		}
	}
}
